package com.pjb.springbootjjwt.store.entity;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Table {

    private String table;   //表名
    private String alias;    //别名

    public static Table toTable(String s) {
        String[] table = s.trim().split("\\s+");
        if (table.length > 1) return new Table(table[0], table[1]);

        return new Table(table[0], table[0]);
    }

    public static Table toTableBySql(String sql) {
        return null;
    }

}
